{include file="public/header"}

<body>
  <div class="layui-fluid">
    <div class="layui-row">
      <form action="" method="post" class="layui-form layui-form-pane">
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">配置名</div>
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <input
                type="text"
                value="{$row.remark|default=''}"
                required=""
                lay-verify="required"
                autocomplete="off"
                class="layui-input"
                disabled
              />
            </div>
          </div>
        </div>
        {if !empty($row.name) && $row.name == 'rate'}
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">提取商家抽成比例</div>
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <input
                type="number"
                name="value[allrate]"
                value="{$row.value.allrate|default='0'}"
                required=""
                lay-verify="required"
                autocomplete="off"
                class="layui-input"
                placeholder="抽取商家每笔订单金额的比例，根据实际订单支付金额进行抽成"
              />
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">街道代理收取的比例</div>
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <input
                type="number"
                name="value[streetrate]"
                value="{$row.value.streetrate|default='0'}"
                required=""
                lay-verify="required"
                autocomplete="off"
                class="layui-input"
                placeholder="街道代理收取每笔订单的比例，请确保各级代理比例总和不超过商家抽成比例"
              />
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">区域代理收取的比例</div>
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <input
                type="number"
                name="value[arearate]"
                value="{$row.value.arearate|default='0'}"
                required=""
                lay-verify="required"
                autocomplete="off"
                class="layui-input"
                placeholder="区域代理收取每笔订单的比例，请确保各级代理比例总和不超过商家抽成比例"
              />
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">城市代理收取的比例</div>
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <input
                type="number"
                name="value[cityrate]"
                value="{$row.value.cityrate|default='0'}"
                required=""
                lay-verify="required"
                autocomplete="off"
                class="layui-input"
                placeholder="城市代理收取每笔订单的比例，请确保各级代理比例总和不超过商家抽成比例"
              />
            </div>
          </div>
        </div>
        {/if} {if !empty($row.name) && $row.name == 'myus'}
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <textarea id="infos" name="value">
{if !empty($row.value)}{:htmlspecialchars_decode($row.value)}{/if}</textarea
              >
            </div>
          </div>
        </div>
        {/if} {if !empty($row.name) && $row.name == 'ptdatas'}
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">平台总交易额</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">初始金额(元)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小金额(元)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大金额(元)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[total][money]"
                        value="{$row.value.total.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[total][time]"
                        value="{$row.value.total.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[total][min]"
                        value="{$row.value.total.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[total][max]"
                        value="{$row.value.total.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">平台总用户</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">初始用户(人)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小人数(人)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大人数(人)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[user][money]"
                        value="{$row.value.user.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[user][time]"
                        value="{$row.value.user.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[user][min]"
                        value="{$row.value.user.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[user][max]"
                        value="{$row.value.user.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">初始活跃用户(人)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小人数(人)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大人数(人)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[huser][money]"
                        value="{$row.value.huser.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[huser][time]"
                        value="{$row.value.huser.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[huser][min]"
                        value="{$row.value.huser.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[huser][max]"
                        value="{$row.value.huser.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">月度趋势数据</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <a
                class="layui-btn layui-btn-btn layui-btn-sm layui-btn-normal"
                onclick="addtable2()"
                >添加数据</a
              >
              <table
                class="layui-table layui-form"
                id="table2"
                lay-filter="table2"
              >
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">日期</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">涨幅百分比</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">操作</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  {if !empty($row.value.order)} {foreach $row.value.order as $k
                  => $v}
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[order][{$k}][key]"
                        value="{$v.key}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[order][{$k}][value]"
                        value="{$v.value}"
                      />
                    </td>
                    <td>
                      <a class="layui-btn layui-btn-danger layui-btn-xs del"
                        >删除</a
                      >
                    </td>
                  </tr>
                  {/foreach} {/if}
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">订单趋势数据</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">月用户访问量(次)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小人数(次)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大人数(次)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fwnumber][money]"
                        value="{$row.value.fwnumber.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fwnumber][time]"
                        value="{$row.value.fwnumber.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fwnumber][min]"
                        value="{$row.value.fwnumber.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fwnumber][max]"
                        value="{$row.value.fwnumber.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">月新增订单量(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小单数(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大单数(单)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[xznumber][money]"
                        value="{$row.value.xznumber.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[xznumber][time]"
                        value="{$row.value.xznumber.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[xznumber][min]"
                        value="{$row.value.xznumber.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[xznumber][max]"
                        value="{$row.value.xznumber.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">月完成订单量(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小单数(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大单数(单)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fnnumber][money]"
                        value="{$row.value.fnnumber.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fnnumber][time]"
                        value="{$row.value.fnnumber.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fnnumber][min]"
                        value="{$row.value.fnnumber.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fnnumber][max]"
                        value="{$row.value.fnnumber.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">订单累计数据</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">待付款订单总量(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小单数(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大单数(单)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber0][money]"
                        value="{$row.value.fallnnumber0.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber0][time]"
                        value="{$row.value.fallnnumber0.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber0][min]"
                        value="{$row.value.fallnnumber0.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber0][max]"
                        value="{$row.value.fallnnumber0.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">待服务订单总量(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小单数(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大单数(单)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber1][money]"
                        value="{$row.value.fallnnumber1.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber1][time]"
                        value="{$row.value.fallnnumber1.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber1][min]"
                        value="{$row.value.fallnnumber1.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber1][max]"
                        value="{$row.value.fallnnumber1.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">服务中订单总量(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小单数(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大单数(单)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber2][money]"
                        value="{$row.value.fallnnumber2.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber2][time]"
                        value="{$row.value.fallnnumber2.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber2][min]"
                        value="{$row.value.fallnnumber2.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber2][max]"
                        value="{$row.value.fallnnumber2.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
            <div class="layui-col-md12">
              <table class="layui-table layui-form">
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">总完成订单量(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间频率(秒)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最小单数(单)</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">变化最大单数(单)</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber3][money]"
                        value="{$row.value.fallnnumber3.money|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber3][time]"
                        value="{$row.value.fallnnumber3.time|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber3][min]"
                        value="{$row.value.fallnnumber3.min|default=0}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[fallnnumber3][max]"
                        value="{$row.value.fallnnumber3.max|default=0}"
                      />
                    </td>
                  </tr>
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">旺旺商城数据</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <a
                class="layui-btn layui-btn-btn layui-btn-sm layui-btn-normal"
                onclick="addtable3()"
                >添加数据</a
              >
              <table
                class="layui-table layui-form"
                id="table3"
                lay-filter="table3"
              >
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">类名</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">占百分比</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">操作</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  {if !empty($row.value.shop)} {foreach $row.value.shop as $k =>
                  $v}
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="text"
                        id="layui-input"
                        class="layui-input"
                        name="value[shop][{$k}][key]"
                        value="{$v.key}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[shop][{$k}][value]"
                        value="{$v.value}"
                      />
                    </td>
                    <td>
                      <a class="layui-btn layui-btn-danger layui-btn-xs del"
                        >删除</a
                      >
                    </td>
                  </tr>
                  {/foreach} {/if}
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">刷订单数据</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <a
                class="layui-btn layui-btn-btn layui-btn-sm layui-btn-normal"
                onclick="addtable4()"
                >添加数据</a
              >
              <table
                class="layui-table layui-form"
                id="table4"
                lay-filter="table4"
              >
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">用户名</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">手机号</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">操作</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  {if !empty($row.value.orderuser)} {foreach
                  $row.value.orderuser as $k => $v}
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="text"
                        id="layui-input"
                        class="layui-input"
                        name="value[orderuser][{$k}][key]"
                        value="{$v.key}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[orderuser][{$k}][value]"
                        value="{$v.value}"
                      />
                    </td>
                    <td>
                      <a class="layui-btn layui-btn-danger layui-btn-xs del"
                        >删除</a
                      >
                    </td>
                  </tr>
                  {/foreach} {/if}
                </tbody>
              </table>
            </div>
          </div>
        </div>
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-header">月平均数据</div>
          <div class="layui-card-body layui-table-body layui-table-main">
            <div class="layui-col-md12">
              <a
                class="layui-btn layui-btn-btn layui-btn-sm layui-btn-normal"
                onclick="addtable5()"
                >添加数据</a
              >
              <table
                class="layui-table layui-form"
                id="table5"
                lay-filter="table5"
              >
                <thead>
                  <tr>
                    <td>
                      <div class="layui-table-cell">类目名称</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">基础数量</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">更新时间间隔</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">最小值</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">最大值</div>
                    </td>
                    <td>
                      <div class="layui-table-cell">操作</div>
                    </td>
                  </tr>
                </thead>
                <tbody>
                  {if !empty($row.value.monethclass)} {foreach
                  $row.value.monethclass as $k => $v}
                  <tr>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="text"
                        id="layui-input"
                        class="layui-input"
                        name="value[monethclass][{$k}][key]"
                        value="{$v.key}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[monethclass][{$k}][value]"
                        value="{$v.value}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[monethclass][{$k}][times]"
                        value="{$v.times}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[monethclass][{$k}][min]"
                        value="{$v.min}"
                      />
                    </td>
                    <td>
                      <input
                        required=""
                        lay-verify="required"
                        type="number"
                        id="layui-input"
                        class="layui-input"
                        name="value[monethclass][{$k}][max]"
                        value="{$v.max}"
                      />
                    </td>
                    <td>
                      <a class="layui-btn layui-btn-danger layui-btn-xs del"
                        >删除</a
                      >
                    </td>
                  </tr>
                  {/foreach} {/if}
                </tbody>
              </table>
            </div>
          </div>
        </div>
        {/if} {if !empty($row.name) && ($row.name == 'xieyi' || $row.name ==
        'xieyi2' || $row.name == 'yszc')}
        <div class="layui-card layui-form" lay-filter="component-form-element">
          <div class="layui-card-body layui-row layui-col-space10">
            <div class="layui-col-md12">
              <textarea id="infos" name="value">
{if !empty($row.value)}{:htmlspecialchars_decode($row.value)}{/if}</textarea
              >
            </div>
          </div>
        </div>
        {/if}
        <div class="layui-form-item">
          <input type="hidden" value="{$row['name']|default=''}" name="name" />
          <button class="layui-btn" lay-submit="" lay-filter="add">提交</button>
        </div>
      </form>
    </div>
  </div>
  {include file="public/footer"}
  <script src="/static/leyedit/Layui-KnifeZ/layui.all.js"></script>
  <script src="/static/leyedit/ace/ace.js"></script>
  <script>
    function addtable2() {
      var i = $("#table2 tbody tr").length;
      //你要添加的html
      var html =
        "<tr>" +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[order][' +
        i +
        '][key]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[order][' +
        i +
        '][value]" value=""></td>' +
        '<td><a class="layui-btn layui-btn-danger layui-btn-xs del" >删除</a></td></tr>';
      $(html).appendTo($("#table2 tbody:last"));
      layui.use(["form"], function () {
        $ = layui.jquery;
        var form = layui.form;
        form.render();
      });
    }
    function addtable3() {
      var i = $("#table3 tbody tr").length;
      //你要添加的html
      var html =
        "<tr>" +
        '<td><input required="" lay-verify="required" type="text" id="layui-input" class="layui-input" name="value[shop][' +
        i +
        '][key]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[shop][' +
        i +
        '][value]" value=""></td>' +
        '<td><a class="layui-btn layui-btn-danger layui-btn-xs del" >删除</a></td></tr>';
      $(html).appendTo($("#table3 tbody:last"));
      layui.use(["form"], function () {
        $ = layui.jquery;
        var form = layui.form;
        form.render();
      });
    }
    function addtable4() {
      var i = $("#table4 tbody tr").length;
      //你要添加的html
      var html =
        "<tr>" +
        '<td><input required="" lay-verify="required" type="text" id="layui-input" class="layui-input" name="value[orderuser][' +
        i +
        '][key]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[orderuser][' +
        i +
        '][value]" value=""></td>' +
        '<td><a class="layui-btn layui-btn-danger layui-btn-xs del" >删除</a></td></tr>';
      $(html).appendTo($("#table4 tbody:last"));
      layui.use(["form"], function () {
        $ = layui.jquery;
        var form = layui.form;
        form.render();
      });
    }
    function addtable5() {
      var i = $("#table5 tbody tr").length;
      //你要添加的html
      var html =
        "<tr>" +
        '<td><input required="" lay-verify="required" type="text" id="layui-input" class="layui-input" name="value[monethclass][' +
        i +
        '][key]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[monethclass][' +
        i +
        '][value]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[monethclass][' +
        i +
        '][times]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[monethclass][' +
        i +
        '][min]" value=""></td>' +
        '<td><input required="" lay-verify="required" type="number" id="layui-input" class="layui-input" name="value[monethclass][' +
        i +
        '][max]" value=""></td>' +
        '<td><a class="layui-btn layui-btn-danger layui-btn-xs del" >删除</a></td></tr>';
      $(html).appendTo($("#table5 tbody:last"));
      layui.use(["form"], function () {
        $ = layui.jquery;
        var form = layui.form;
        form.render();
      });
    }
    $("body").on("click", ".del", function () {
      $(this).closest("tr").remove();
    });
    layui.use(["form", "layer", "upload", "upload", "layedit"], function () {
      $ = layui.jquery;
      var form = layui.form,
        upload = layui.upload,
        element = layui.element,
        layer = layui.layer,
        layedit = layui.layedit;
      layedit.set({
        //暴露layupload参数设置接口 --详细查看layupload参数说明
        uploadImage: {
          url: "/Base/upload_img",
          accept: "image",
          acceptMime: "image/*",
          exts: "jpg|png|gif|bmp|jpeg",
          size: "100240",
        },
        //右键删除图片/视频时的回调参数，post到后台删除服务器文件等操作，
        //传递参数：
        //图片： imgpath --图片路径
        //视频： filepath --视频路径 imgpath --封面路径
        calldel: {
          url: "/Base/upload_img",
        },
        //开发者模式 --默认为false
        devmode: false,
        //插入代码设置
        codeConfig: {
          hide: true, //是否显示编码语言选择框
          default: "javascript", //hide为true时的默认语言格式
        },

        tool: [
          "strong",
          "italic",
          "underline",
          "del",
          "|",
          "left",
          "center",
          "right",
        ],
        height: "300px",
      });
      //监听提交
      var infos = layedit.build("infos");
      form.on("submit(add)", function (data) {
        data.field.value = layedit.getContent(infos);
        //发异步，把数据提交给php
        $.ajax({
          type: "post",
          data: data.field,
          success: function (res) {
            if (res.status == 0) {
              layer.msg(res.msg, { icon: 6, time: 1000 }, function () {
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                parent.location.reload();
                parent.layer.close(index);
              });
            } else {
              layer.msg(res.msg, { icon: 2, time: 1000 });
            }
          },
        });
        return false;
      });
    });
  </script>
</body>
